Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
La solicitud de autorización de la API de Amadeus falla porque "falta el parámetro de formulario grant_type obligatorio"

Estoy tratando de solicitar un token de autorización de Amadeus usando axios siguiendo esta documentación . Sin embargo, no tengo mucha experiencia con la biblioteca axios y no puedo generar la solicitud correctamente, porque recibo esta respuesta:

 code: 38187 error: "invalid_request" error_description: "Mandatory grant_type form parameter missing" title: "Invalid parameters"

Lo curioso es que traté de simular la misma solicitud con curl y funcionó, así que estoy realmente desconcertado en cuanto a dónde está mi error. A continuación se muestra mi solicitud de curl

 curl -v "https://test.api.amadeus.com/v1/security/oauth2/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id=xxxxxx&client_secret=xxxxxx"

Aquí está mi código JavaScript, ¡hágamelo saber si puede notar la diferencia! Gracias por adelantado

 async getAmadeusKey() { const response = await axios({ url: "https://test.api.amadeus.com/v1/security/oauth2/token", method: 'post', headers: { 'Content-Type': 'x-www-form-urlencoded' }, data: { grant_type: 'client_credentials', client_id: CLIENT_ID, // of course both these constants are defined outside of this scope client_secret: CLIENT_SECRET, } }); console.log(response.data); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!